<?php
// +----------------------------------------------------------------------
// | Tplay [ WE ONLY DO WHAT IS NECESSARY ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017 http://tplay.pengyichen.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 听雨 < 389625819@qq.com >
// +----------------------------------------------------------------------


namespace app\index\controller;

use app\index\controller\Base;
use \think\Db;
class About extends Base
{

    public function index(){
        $about=Db::name('company1')->where('class',$this->request->param('class'))->find();
        switch ($this->request->param('class')) {
            case 'call':
                $about['index']='联系我们';
                $menu=7;
                $left=13;
                break;
            case 'range':
                $about['index']='服务范围';
                $menu=2;
                $left=10;
                break;
            case 'dec':
                $about['index']='关于我们';
                $menu=9;
                $left=11;
                break;
            case 'hezuo':
                $about['index']='合作机会';
                $menu=8;
                $left=14;
                break;
        }
             $left_menu=Db::name("index_menu")->where(["state"=>0,"type"=>1])->order("id","asc")->select();
            foreach ($left_menu as $key => $value) {
                $url = url($value['url']);
                $left_menu[$key]['urll'] = $url;
            }
            $this->assign("left_menu",$left_menu);
            $seo=Db::name("seo")->where("class",$this->request->param('class'))->find();
            $this->assign("seo",$seo);
            $this->assign("about",$about);
            $this->assign("_title",$about['index']);
            $this->assign("menu",$menu);
            $this->assign("left",$left);
            return $this->fetch();
    }

}